import java.util.*;

public class ClientWorkLoad3 extends Client {
	private static int []queries = new int [] {13, 15, 17, 1, 22, 11, 3, 4, 7, 20, 14, 21, 9, 8, 2, 18, 16, 6, 10, 12, 5, 19};
	private int currentIteration;
	
	public ClientWorkLoad3(int iterations, int _currentIteration, int clientID, ArrayList<Result> _results) {
		super(iterations, clientID);
		result = _results;
		currentIteration = _currentIteration;
	}
	
	public void runUpdates(int updateToUse) {
		ArrayList<String> updates = QueryGenerator.GetUpdatePair(updateToUse);
		for(int j=0; j<updates.size(); j++) { 
			RunUpdate("I" + currentIteration + "-" + "U" + j, updates.get(j));
		}
	}
	
	public void disconnect() {
		DB.Disconnect(connection);
	}
	
	public void run() {
		for(int j=0; j<queries.length; j++) {
			RunQuery("I" + currentIteration + "-" + "Q" + queries[j], QueryGenerator.Q(queries[j]));
		}
	}
}
